import WebFont from 'webfontloader';


export const loadFonts = () => {
    return new Promise((resolve, reject) => {
      WebFont.load({
        google: {
          families: ['Roboto:400,700', 'Open Sans:300,400'] // 需要加载的 Google 字体
        },
        custom: {
          families: ['MyCustomFont'], // 自定义字体名称
          urls: ['/fonts/custom-font.css'] // 自定义字体 CSS 路径
        },
        active: () => resolve(0), // 字体加载成功
        inactive: () => reject(new Error('字体加载失败')) // 字体加载失败
      });
    });
  };